package ibm.abacus.classpath;

import java.util.Iterator;
import java.util.Map;
import java.util.Map.Entry;

/**
 * 1. 程序运行后，更改java.class.path是不能够动态更改System Class Loader的加载路径。<br />
 * 2. 在Eclipse中启动，-cp 自动更改为D:\workspace\eclipse\ibm.abacus.study\bin以及project
 * class path里面加入的jar包等。直接在VM中添加-cp xx.jar, 这个xx.jar不会被加载。
 * 
 * @author huchangchun
 * 
 */

public class ClassPathTester {

	/**
	 * @param args
	 */
	public static void main(String[] args) {


		System.out.println(System.getProperty("java.ext.dirs"));
		System.out.println(System.getProperty("sun.boot.class.path"));
		System.out.println(System.getProperty("java.library.path"));
		System.out.println(System.getProperty("java.class.path"));
		
		System.out.println(System.getProperty("systemClassLoader"));
		System.out.println(System
				.getProperty("com.ibm.oti.vm.bootstrap.library.path"));
		
//		System.out.println(classpath);

//		classpath += ";D:\\workspace\\eclipse\\ibm.abacus.quote\\bin\\ibm.jar";
//		System.setProperty("java.class.path", classpath);
//		System.out.println(System.getProperty("java.class.path"));

		Iterator<Entry<Object, Object>> it = System.getProperties().entrySet()
				.iterator();
		while (it.hasNext()) {
			Map.Entry entry = it.next();
			String key = (String) entry.getKey();
			String value = (String) entry.getValue();
			if(value.contains(":\\")){
				System.out.println(key);
				System.out.println(value);
			}
		}

		try {
			ClassLoader.getSystemClassLoader()
					.loadClass("ibm.abacus.quote.Trd");
			System.out.println("Done!!!");
		} catch (ClassNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
